package cn.cjlmonster.demo02.widget;

import android.content.Context;

import com.github.mikephil.charting.components.MarkerView;
import com.github.mikephil.charting.utils.MPPointF;

import cn.cjlmonster.demo02.R;

/**
 * cn.cjlmonster.demo02.widget
 *
 * @author cjl
 * @project Demo02
 * @date 2022/4/17 3:05 下午
 */
public class RadialCircleMarketView extends MarkerView {

    public RadialCircleMarketView(Context context) {
        super(context, R.layout.layout_circle_radial);
    }

    private MPPointF mOffset;

    @Override
    public MPPointF getOffset() {

        if (mOffset == null) {
            // center the marker horizontally and vertically
            mOffset = new MPPointF(-getWidth() / 2f, -getHeight() / 2f);
        }

        return mOffset;
    }
}
